﻿namespace WayneGameSolution.Packs
{
    using System;
    using System.Collections.Generic;

    public sealed class WorkingPackNode : IWorkingPackNode
    {
        private Dictionary<string, string> _Attritues;
        private List<IWorkingPackNode> _ChildNodes;
        private string _Name;
        private string _Value;

        public WorkingPackNode()
        {
            this._Attritues = new Dictionary<string, string>();
            this._ChildNodes = new List<IWorkingPackNode>();
            this._Name = "UnNamed";
            this._Value = string.Empty;
        }

        public WorkingPackNode(string name, IEnumerable<IWorkingPackNode> childs, IDictionary<string, string> attribs)
        {
            this._Attritues = new Dictionary<string, string>();
            this._ChildNodes = new List<IWorkingPackNode>();
            this._Name = "UnNamed";
            this._Value = string.Empty;
            this.Name = name;
            this._ChildNodes.AddRange(childs);
            this._Attritues = (Dictionary<string, string>) attribs;
        }

        public IDictionary<string, string> Attritues
        {
            get
            {
                return this._Attritues;
            }
            set
            {
                this._Attritues = (Dictionary<string, string>) value;
            }
        }

        public IList<IWorkingPackNode> ChildNodes
        {
            get
            {
                return this._ChildNodes;
            }
            set
            {
                this._ChildNodes = (List<IWorkingPackNode>) value;
            }
        }

        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this._Name = value;
            }
        }

        public string Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                this._Value = value;
            }
        }

        public IDictionary<string, string> WayneGameSolution.Packs.IWorkingPackNode.Attritues
        {
            get
            {
                return this._Attritues;
            }
            set
            {
                this._Attritues = (Dictionary<string, string>) value;
            }
        }

        public IList<IWorkingPackNode> WayneGameSolution.Packs.IWorkingPackNode.ChildNodes
        {
            get
            {
                return this._ChildNodes;
            }
            set
            {
                this._ChildNodes = (List<IWorkingPackNode>) value;
            }
        }

        public string WayneGameSolution.Packs.IWorkingPackNode.Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this._Name = value;
            }
        }

        public string WayneGameSolution.Packs.IWorkingPackNode.Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                this._Value = value;
            }
        }
    }
}

